const auth = (req, res, next) => {
    if (req.session.user) {
        // 重新设置session
        req.session.date = new Date();
        next();
    } else {
        return res.send({ code: 401, msg: "请先登录" });
    }
};

module.exports = auth;
